<?php

// get languages item
	$d = ($edit) ? $module->languages_get($edit) : false;

// title
	?><h1 class="<?php echo ($add) ? 'add' : 'edit'; ?>"><?php echo ($add) ? $lang->get('add-languages') : $lang->get('edit-languages'); ?></h1><?php

// form
	?>
	<form name="frm" method="post" action="<?php echo $cosa->system('base-url'); ?>/?m=<?php echo $m; ?>&s=<?php echo $s; ?>">
	<input type="hidden" name="<?php echo ($add) ? 'add' : 'edit'; ?>" value="<?php echo ($add) ? '1' : $d['id']; ?>" />
	<ul>
		<li><label for="name"><?php $lang->put('domain-name'); ?></label>
			<select name="domain_id">
				<?php
				$domains = $module->getDomains();
				foreach($domains as $k => $v) {
					$selected = ($d && $v['id'] == $d['domain_id']) ? ' selected="selected"' : '';
					?><option value="<?php echo stripslashes($v['id']); ?>"<?php echo $selected; ?>><?php echo stripslashes($v['name']); ?></option><?php
				}
				?>
			</select>
		</li>
		<li><label for="name"><?php $lang->put('name'); ?></label>
			<input type="text" name="name" id="name" value="<?php if($d) echo stripslashes($d['name']); ?>" class="fld" />
		</li>
		<li><label for="short"><?php $lang->put('language-short'); ?></label>
			<input type="text" name="short" id="short" value="<?php if($d) echo stripslashes($d['short']); ?>" class="fld" />
		</li>
		<li><h3><?php $lang->put('country-information'); ?></h3>
			<ul style="margin-top:10px;">
				<li><label for="email"><?php $lang->put('email'); ?></label>
					<input type="text" name="email" id="email" value="<?php if($d) echo stripslashes($d['email']); ?>" class="fld" />
				</li>
				<li><label for="text"><?php $lang->put('text'); ?></label>
					<textarea name="text" id="text"><?php if($d) echo stripslashes($d['text']); ?></textarea>
				</li>
			</ul>
		</li>
		<li><input type="checkbox" name="active" id="active" value="1" <?php if($d && $d['active']) echo 'checked="checked"'; ?> class="cbx" />
			<label for="active"><?php $lang->put('active'); ?></label>
		</li>
		<li><input type="checkbox" name="default" id="default" value="1" <?php if($d && $d['default']) echo 'checked="checked"'; ?> class="cbx" />
			<label for="default"><?php $lang->put('default'); ?></label>
		</li>
		<li><label for="domain_local_name">Domain name (localized name)</label>
			<input type="text" name="domain_local_name" id="domain_local_name" value="<?php if($d) echo stripslashes($d['domain_local_name']); ?>" class="fld" />
		</li>
		<li class="sbmt">
			<input type="submit" value="<?php $lang->put('submit'); ?>" class="sbmt" />
			<?php if($d) $module->printDelLink($d['id'], false, $lang->get('del-languages')); ?>
		</li>
	</ul>
	</form>
